package com.wind.taobao.api.trade.user.rest
{
	import com.wind.taobao.api.IPublicAPI;
	import com.wind.taobao.core.exception.InvalidRequestParametersException;
	import com.wind.taobao.core.util.TaobaoUtils;
	import com.wind.taobao.core.webservice.TaobaoRequest;

	/**
	 * taobao.users.get Request
	 * @author fxy
	 *
	 */
	public class UsersGetRequest extends TaobaoRequest implements IPublicAPI
	{
		public override function get method():String
		{
			return "taobao.users.get"
		}
		/**
		 * Y 	 查询字段：User数据结构的公开信息字段列表，以半角逗号(,)分隔
		 */
		[Bindable]
		public var fields:String="user_id,nick,sex,buyer_credit,seller_credit,location,created,last_visit";
		/**
		 * Y 	用户昵称，多个以半角逗号(,)分隔,最多40个
		 */
		[Bindable]
		public var nicks:String;

		public override function validate():void
		{
			if (!TaobaoUtils.hasValue(fields))
			{
				throw new InvalidRequestParametersException("请求参数[fields]不能为空");
			}
			if (!TaobaoUtils.hasValue(nicks))
			{
				throw new InvalidRequestParametersException("请求参数[nicks]不能为空");
			}
		}
	}
}